<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" 	prefix="s"%>
<%@ include file="/jsp/common/common_head.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
<title>示界港管理平台</title>
<%@ include file="/jsp/common/common_script.jsp"%>
<link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.css">
<style type="text/css">
</style>
<script type="text/javascript">
 var g_userId = '<%=session.getAttribute("userId")%>';
</script>
</head>
<body>
<table class="queryTable" >
	<tr>
		<td class="queryTitle" width="80px">订单状态</td>
		<td class="queryContent">
			<select id="queryState" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 145px">
				<option value="0" selected>[不限]</option>
				<option value="10">待支付</option>
				<option value="11">已支付</option>
				<option value="12">支付失败</option>
				<option value="20">制作中</option>
				<option value="30">配送中</option>
				<option value="40">完成</option>
				<option value="50">取消</option>
				<option value="101">有效统计</option><!-- 11+20+30+40 -->
			</select> 
		</td>
		<td class="queryTitle" width="80px">＊合作方</td>
		<td class="queryContent">
			<select id="queryPartner" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 145px">
			</select> 
		</td>
		<td class="queryTitle" width="80px">支付平台</td>
		<td class="queryContent">
			<select id="queryPayPf" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px">
				<option value="0" selected>[不限]</option>
				<option value="10">微信</option>
				<option value="20">支付宝</option>
				<option value="30">苹果内购</option>
			</select> 
		</td>
		<td class="queryTitle" width="80px">订单类型</td>
		<td class="queryContent">
			<select id="queryType" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px">
				<option value="" selected>[不限]</option>
				<option value="0">普通订单</option>
				<option value="1">VIP订单</option>
				<option value="10">被拆分订单</option>
				<option value="20">秒杀订单</option>
			</select> 
		</td>
		<td class="queryBtnTd" rowspan="3">
			<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search"  onclick="doQuery(1)">查询</a>
		</td>
	</tr>
	<tr>
		<td class="queryTitle" width="80px">＊起始日期</td>
		<td class="queryContent">
			<input id="queryDateStart" class="easyui-datetimebox" style="width:145px">
		</td>
		<td class="queryTitle" width="80px">＊截止日期</td>
		<td class="queryContent">
			<input id="queryDateEnd" class="easyui-datetimebox" style="width:145px">
		</td>
		<td class="queryTitle" width="80px">发票ID</td>
		<td class="queryContent">
			<input class="inputText" type="text" style="width:120px" id="queryInvId" /> 
		</td>
		<td class="queryTitle" width="80px">用户手机</td>
		<td class="queryContent">
			<input class="inputText" type="text" style="width:120px" id="queryMobile" /> 
		</td>
	</tr>
	<tr>
		<td class="queryTitle" width="80px">订单编号</td>
		<td class="queryContent">
			<input class="inputText" type="text" style="width:145px;" id="queryOrderNo" />
		</td>
		<td class="queryTitle" width="80px"><span style="color:red">支付订单编号</span></td>
		<td class="queryContent">
			<input class="inputText" type="text" style="width:145px;" id="queryPayOrderNo" />
		</td>
		<td class="queryTitle" width="80px">订单ID</td>
		<td class="queryContent">
			<input class="inputText" type="text" style="width:120px" id="queryOrderId" /> 
		</td>
		<td class="queryTitle" width="80px">用户ID</td>
		<td class="queryContent">
			<input class="inputText" type="text" style="width:120px" id="queryUserId" /> 
		</td>
	</tr>
</table>

<table id="ordersGrid"></table>

<!-- 用于查看导出的信息 -->
<div id="exOrder" class="easyui-window" title="" closed="true" style="width:1100px;height:500px;center; background: #fff;">
	<div style="clear:both;padding-top:10px;margin-bottom:10px;" id="exOrderBtn">
	<table>
		<tr>
		<td class="queryTitle" width="68px"><p style="font-size: 10px;color:#FF00FF;">＊合作方</p></td>
		<td class="queryContent">
			<select id="exPartner" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 100px">
			</select> 
		</td>
		<td class="queryTitle" width="70px"><p style="font-size: 13px;color: #FF00FF;">＊起始日期</p></td>
		<td class="queryContent">
			<input id="exStartDate" style="width:135px" class="easyui-textbox">
		</td>
		<td class="queryTitle" width="70px"><p style="font-size:13px;color:#FF00FF;">＊截止日期</p></td>
		<td class="queryContent">
			<input id="exEndDate" style="width:135px" class="easyui-textbox">
		</td>
		<td class="queryContent">
			<a class="easyui-linkbutton" iconCls="icon-print" href="javascript:void(0)" plain="true" onclick="downOrderInfo(0,1,0)">导出订单详情</a>
		</td>
	<!-- 	<td class="queryContent">
			<a class="easyui-linkbutton" iconCls="icon-print" href="javascript:void(0)" plain="true" onclick="downOrderInfo(0,0,1)">高精度导出</a>
		</td> -->
		<td class="queryContent">
			<a class="easyui-linkbutton" align="right" iconCls="icon-cancel" href="javascript:void(0)" plain="true" onclick="cancleDown()">取消</a>
		</td>
		</tr>
	</table>
    </div>
	<s:hidden name="allIds" id="allIds"></s:hidden>
	<table id="exOrderGrid"></table>
</div>

<div id="stateDlg" class="easyui-window" title="" closed="true" style="width:600px; height:280px;text-align:center; background: #fff;">
	<div border="false" style="padding-left:20px;">
		<form id="stateForm"  method="POST">
			<s:hidden name="updOrderId" id="updOrderId"/>
			<s:hidden name="updDetailId" id="updDetailId"/>
			<s:hidden name="updRecdInfo" id="updRecdInfo"/>
			<table border="0" class="queryTable" width="95%" height="auto" style="margin-bottom:0px;" id="stateTable">
				<tr>	
					<td class="queryTitle" width="100px">订单/明细编号</td>
					<td class="queryContent" >
						<span id="updOrderNo" style="color:red;"></span>
					</td>
				</tr>
				<tr>
					<td class="queryTitle" width="100px">反馈状态</td>
					<td class="queryContent">
						<select id="updOrderState" class="easyui-combobox" panelHeight="auto" editable="false" style="width:120px" >
							<option value="0" selected>[未知]</option>
							<option value="10">待支付</option>
							<option value="11">已支付</option>
							<option value="12">支付失败</option>
							<option value="20">制作中</option>
							<option value="30">配送中</option>
							<option value="40">完成</option>
							<option value="50">取消</option>
						</select>
					</td>
				</tr>
				<tr>	
					<td class="queryTitle" width="100px">描述信息</td>
					<td class="queryContent">
						<textarea id="updDesc" rows="6" cols="55" class="inputText easyui-validatebox" style="width:100%;resize:none;"></textarea>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="stateBtn">
		<a class="easyui-linkbutton" iconCls="icon-ok" href="javascript:void(0)" onclick="doUpdState()">更新</a>
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="cancelUpdState()">取消</a>
    </div>
</div>

<div id="detailDlg" class="easyui-window" title="" closed="true" style="width:920px; height:500px;text-align:center; background: #fff;">
	<div border="false" style="padding-left:10px;padding-right:10px;">
		<form id="detailForm"  method="POST">
			<s:hidden name="dtlOrderId" id="dtlOrderId"/>
			<table border="0" class="queryTable" width="440px" height="auto" style="margin-bottom:0px;" id="dtlTable">
				<tr>	
					<td class="queryTitle" width="100px">(主)订单编号</td>
					<td class="queryContent" width="100px">
						<span id="dtlOrderNo" style="color:red;"></span>
					</td>
					<td class="queryTitle" width="100px">用户ID</td>
					<td class="queryContent" width="100px">
						<span id="dtlUserId" style="color:red;"></span>
					</td>
				</tr>
			</table>
			<table id="detailGrid"></table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="detailBtn">
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="closeDetail()">关闭</a>
    </div>
</div>

<div id="expressDlg" class="easyui-window" title="" closed="true" style="width:500px; height:200px;text-align:center; background: #fff;">
	<div border="false" style="padding-left:10px;padding-right:10px;">
		<form id="expressForm"  method="POST">
			<s:hidden name="expDetailId" id="expDetailId"/>
			<table border="0" class="queryTable" width="400px" height="auto" style="margin-bottom:0px;" id="expressTable">
				<tr>	
					<td class="queryTitle" width="100px">订单明细编号</td>
					<td class="queryContent" colspan="2">
						<span id="expDetailNo" style="color:red;"></span>
					</td>
				</tr>
				<tr>	
					<td class="queryTitle" width="100px">快递/物流公司</td>
					<td class="queryContent">
						<select id="expType" class="easyui-combobox" style="width:120px;">
						</select>
					</td>
					<td class="queryContent">
						<input class="inputText" type="text" style="width:120;" id="editExpress" />
					</td>
				</tr>
				<tr>	
					<td class="queryTitle" width="100px">运单号</td>
					<td class="queryContent" colspan="2">
						<input class="inputText" type="text" style="width:240;" id="editTrackNo" />
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="expressBtn">
		<a class="easyui-linkbutton" iconCls="icon-ok" href="javascript:void(0)" onclick="doUpdExp()">更新</a>
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="cancelUpdExp()">取消</a>
    </div>
</div>

<div id="partnerDlg" class="easyui-window" title="" closed="true" style="width:400px; height:170px;text-align:center; background: #fff;">
	<div border="false" style="padding-left:20px;">
		<form id="partnerForm"  method="POST">
			<s:hidden name="parOrderId" id="parOrderId"/>
			<s:hidden name="parDetailId" id="parDetailId"/>
			<table border="0" class="queryTable" width="95%" height="auto" style="margin-bottom:0px;" id="partnerTable">
				<tr>	
					<td class="queryTitle" width="100px">订单编号</td>
					<td class="queryContent" >
						<span id="parOrderNo" style="color:red;"></span>
					</td>
				</tr>
				<tr>
					<td class="queryTitle" width="100px">合作方</td>
					<td class="queryContent">
						<select id="updPartner" class="easyui-combobox" panelHeight="auto" editable="false" style="width:120px" >
						</select>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="partnerBtn">
		<a class="easyui-linkbutton" iconCls="icon-ok" href="javascript:void(0)" onclick="doUpdPartner()">更新</a>
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="cancelUpdPartner()">取消</a>
    </div>
</div>

<div id="downDlg" class="easyui-window" title="" closed="true" style="width:400px; height:140px;text-align:center; background: #fff;">
	<div border="false" style="padding-left:10px;padding-right:10px;">
		<form id="downForm"  method="POST">
			<table border="0" class="queryTable" width="360px" height="auto" style="margin-bottom:0px;" id="downTable">
				<tr>	
					<td class="queryTitle" width="100px" height="30px"><span style="color:red;">点击下载</span></td>
					<td class="queryContent" width="260px" >
						<a id="downA"></a>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="downBtn">
		<a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" plain="true" onclick="cancelDown()">取消</a>
    </div>
</div>

<div id="coupon" class="easyui-window" title="" closed="true" style="width:1100px; height:500px;text-align:center; background: #fff;">
	<div border="false" style="padding-left:10px;padding-right:10px;">
		<form id="couponForm"  method="POST">
			<s:hidden id="hiCouponUserId"></s:hidden>
			<table class="queryTable" >
			<tr>	
				<td class="queryTitle" width="80px">优惠券状态</td>
				<td class="queryContent">
					<select id="queryYhState" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px">
						<option value="0" selected>[不限]</option>
						<option value="10">尚未兑换</option>
						<option value="15">已领取</option>
						<option value="20">已兑换</option>
						<option value="30">已下单</option>
						<option value="40">已使用</option>
					</select>
				</td>
				<td class="queryTitle" width="80px">限定范围</td>
				<td class="queryContent">
					<select id="queryYhLimit" class="easyui-combobox" panelHeight="auto" editable="false" style="width: 120px">
						<option value="0" selected>[不限]</option>
						<option value="1">海报模版</option>
						<option value="2">多页模版</option>
						<option value="3">PPT模版</option>
						<option value="4">印品</option>
						<option value="9">虚拟商品</option>
						<option value="1010">Logo商品</option>
					</select>
				</td>
				<td class="queryTitle" width="80px">兑换用户ID:</td>
				<td class="queryContent">
					<input class="inputText" type="text" id="queryConverUserId" />
				</td>
				<td class="queryBtnTd" rowspan="2">
					<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search"  onclick="queryCoupon()">查询</a>
				</td>
				<td class="queryContent" rowspan="2">
					用户ID:<span id="couponUserId" style="color:330000;font-size:20px;"></span>
				</td>
			</tr>
			<tr>
				<td class="queryTitle" width="80px">有效开始日期</td>
				<td class="queryContent">
					<input id="queryExpiryDateStart" class="easyui-datebox" style="width:120px">
				</td>
				<td class="queryTitle" width="80px">有效截止日期</td>
				<td class="queryContent">
					<input id="queryExpiryDateEnd" class="easyui-datebox" style="width:120px">
				</td>
				<td class="queryTitle" width="80px">优惠券码</td>
				<td class="queryContent">
					<input class="inputText" type="text" id="queryYhCode" />
				</td>
			</tr>
		</table>
		<table id="couponGrid"></table>
		</form>
	</div>
</div>

<div id="grantDlg" class="easyui-window" title="" closed="true" style="width:600px; height:260px;text-align:center; background: #fff;">
	<div border="false" style="padding-left:10px;padding-right:10px;">
		<form id="grantForm"  method="POST">
			<s:hidden name="grantCId" id="grantCId"/>
			<s:hidden id="grantUserId"></s:hidden>
			<table border="0" class="queryTable" width="95%" height="auto" style="margin-bottom:0px;" id="grantTable">
				<tr>
					<td class="queryTitle" width="100px"><span style="color:red">优惠码</span></td>
					<td class="queryContent">
						<span id="grantCCd" style="color:red"></span>
					</td>
					<td class="queryTitle" width="100px"><span style="color:red">被送福利用户ID</span></td>
					<td class="queryContent">
						<span id="grantSpanUserId" style="color:red"></span>
					</td>
				</tr>
				<tr>
					<td class="queryTitle" width="100px">有效截止时间</td>
					<td class="queryContent" colspan="3">
						<input id="grantExpiryTime" class="easyui-datebox" style="width:140px">
					</td>
				</tr>
				<tr>	
					<td class="queryTitle" width="100px">描述信息</td>
					<td class="queryContent" colspan="3">
						<textarea id="grantDesc" name="grantDesc" rows="4" cols="55" class="inputText easyui-validatebox" style="width:100%;resize:none;" data-options="required:true,validType:['maxLength[180]']"></textarea>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="grantBtn">
		<a class="easyui-linkbutton" plain="true" iconCls="icon-ok" href="javascript:void(0)" onclick="doGrant()">发送优惠券</a>
		&nbsp&nbsp&nbsp
		<a class="easyui-linkbutton" plain="true" iconCls="icon-cancel" href="javascript:void(0)" onclick="cancelGrant()">取消发送</a>
    </div>
</div>

<div id="downOrdDiv" class="easyui-window" title="" closed="true" style="width:400px; height:190px;text-align:center; background: #fff;">
	<div style="clear:both;padding-top:10px;margin-bottom:10px;text-align:center;" id="downBtn">
		<table class="queryTable">
			<tr>
				<td><a class="easyui-linkbutton" iconCls="icon-save" href="javascript:void(0)" plain="true" onclick="downOrderInfo(0,1)">导出正常订单</a></td>
				<td><a class="easyui-linkbutton" iconCls="icon-save" href="javascript:void(0)" plain="true" onclick="downOrderInfo(1,1)">导出高精度订单</a></td>
			</tr>
			<tr>
				<td><a class="easyui-linkbutton" style="color:green;" iconCls="icon-save" href="javascript:void(0)" plain="true" onclick="downOrderInfo(0,-2)">导出正常1mm出血订单</a></td>
				<td><a class="easyui-linkbutton" style="color:green;" iconCls="icon-save" href="javascript:void(0)" plain="true" onclick="downOrderInfo(1,-2)">导出高精1mm出血订单</a></td>
			</tr>
			<tr>
				<td><a class="easyui-linkbutton" style="color:red;" iconCls="icon-save" href="javascript:void(0)" plain="true" onclick="downOrderInfo(0,-1)">导出正常2mm出血订单</a></td>
				<td><a class="easyui-linkbutton" style="color:red;" iconCls="icon-save" href="javascript:void(0)" plain="true" onclick="downOrderInfo(1,-1)">导出高精2mm出血订单</a></td>
			</tr>
			<tr>
				<td><a class="easyui-linkbutton" iconCls="icon-save" href="javascript:void(0)" plain="true" onclick="downOrderInfo(0,0)">导出正常3mm出血订单</a></td>
				<td><a class="easyui-linkbutton" iconCls="icon-save" href="javascript:void(0)" plain="true" onclick="downOrderInfo(1,0)">导出高精3mm出血订单</a></td>
			</tr>
		</table>
    </div>
</div>


<script type="text/javascript" src="${ctx}/js/tg/uploadcom.js"></script>
<script type="text/javascript" src="${ctx}/js/tg/ajaxupload.js"></script>
<script type="text/javascript" src="${ctx}/js/trade/ordersInfo.js"></script>
<script type="text/javascript" src="${ctx}/js/encrypt/encrypted-min.js"></script>
</body>
</html>
